package cn.cboard.database;

import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;

import org.apache.log4j.Logger;

public class QueryTest extends TestCase{
	private static final Logger logger = Logger.getLogger(QueryTest.class);
	private final Query query = JdbcBuilder.beginPoolQuery();
	
	public void testQuerySingleObject(){
		String sqlquery = "select lastTopicId from forumforums where forumid=?";
		List queryParams = new ArrayList();
		queryParams.add(2);
		Long lastTopicId = new Long(0);
		try {
			lastTopicId = (Long) query.querySingleObject(queryParams, sqlquery);
		} catch (Exception e) {
			logger.debug(e);
		}
		assertEquals("Id Error:",new Long(10),lastTopicId);
		
	}

}
